package com.x.aoki.order.openfeign.hystrix.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 可以为 feign 添加统一的降级服务配置，需要新建一个类(PaymentFeignHystrixServiceImpl)实现当前接口
 * @author caoy
 * @date 2025-02-17 14:32:29
 */
@Component
@FeignClient(value = "X-PAYMENT-HYSTRIX-PROVIDER",fallback = PaymentFeignHystrixServiceImpl.class)
public interface PaymentFeignHystrixService {

    @GetMapping("payment/hystrix/ok/{id}")
    public String paymentInfo_OK(@PathVariable("id") Integer id);
    @GetMapping("payment/hystrix/timeout/{id}")
    public String paymentInfo_Timeout(@PathVariable("id") Integer id);
    @GetMapping("payment/hystrix/circuitbreaker/timeout/{id}")
    public String paymentCircuitBreaker(@PathVariable("id") Integer id);
}
